package com.sjlh.centurylianhua.controller;

import com.sjlh.centurylianhua.entity.SaleList;
import com.sjlh.centurylianhua.mapper.SaleListMapper;
import com.sjlh.centurylianhua.utils.ResultData;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@CrossOrigin
@RestController
@RequestMapping("/salelist")
public class SaleListController {
    @Resource
    private SaleListMapper saleListMapper;
    @RequestMapping("/add")
    public Object add(@RequestBody SaleList saleList){
        int r=saleListMapper.insert(saleList);
        System.out.println(saleList);
        if (r==1){
            return new ResultData(true,20000,"添加成功！",true,null);
        }else {
            return new ResultData(true,20000,"添加失败！",false,null);
        }

    }
}
